package top.ytazwc.proxy;

/**
 * @author 00103943
 * @date 2025-03-18 14:40
 * @package top.ytazwc.proxy
 * @Description
 */
public class SmsProxy implements SmsService{

    private final SmsService smsService;

    public SmsProxy(SmsService smsService) {
        this.smsService = smsService;
    }

    @Override
    public String send(String message) {
        // 调用方法之前执行自己的操作
        System.out.println("before method send()");

        String res = smsService.send(message);

        // 调用方法后 执行自己的操作
        System.out.println("after method send()");
        return res;
    }
}
